package light.head.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Formula;
/**
 * 报销类别
 */
@Entity
@Table
public class ReimburseCategory implements Serializable{
	
	private static final long serialVersionUID = 3025005425053660854L;
	private Integer code;
	private String name;			//类别名称
	private Integer cu;
	private Integer oc;
	private Date ct;
	private Boolean deleted = false;
	
	private String cn;
	private String on;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public String getName() {
		return name;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getCt() {
		return ct;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = cu)")
	public String getCn() {
		return cn;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code = oc)")
	public String getOn() {
		return on;
	}
	
	
	
	
	
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setCn(String cn) {
		this.cn = cn;
	}
	public void setOn(String on) {
		this.on = on;
	}
	
	
	
}
